import request from '@/utils/request'
import { mergeParams } from '@/utils'
import newRequest from '@/utils/newRequest'

export function login(data) {
  return request({
    url: `/login`,
    method: 'post',
    data
  })
}

export function newGetUserInfo(data) {
  return newRequest({
    url: `/MTSaas/xjsTech/doThisUserInfo`,
    method: 'post',
    data
  })
}

export function newLogin(data) {
  return newRequest({
    url: `/SYS/HRAILOGIN/LOGIN`,
    method: 'post',
    data
  })
}
// 获取流程状态
export function doQueryFlowStatus(data) {
  return newRequest({
    url: `/SYS/SysParam/doQueryFlowStatus`,
    method: 'post',
    data
  })
}

/* export function newLogin(data) {
  return newRequest({
    url: `/SYS/SMS/verifyCode`,
    method: 'post',
    data
  })
}*/

export function autoLogin(data) {
  return request({
    url: `/auto-login`,
    method: 'post',
    data
  })
}

export function refreshtoken(data) {
  return request({
    url: '/refreshtoken',
    method: 'post',
    data
  })
}

// export function getInfo() {
//   return request({
//     url: '/api/v1/getinfo',
//     method: 'get'
//   })
// }
// 最新用户信息
export function getInfo(query) {
  const data = mergeParams(query)
  return newRequest({
    url: `/SYS/SMS/getTestUserData`,
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/api/v1/logout',
    method: 'post'
  })
}

